package com.ljy.my_study.java.gc;

/**
 * @author lijunying
 * @date 2021/1/5 8:48
 */
public class TestStackDeep {

    private static int count=0;

    public static void recursion(long a,long b,long c){
        long e=1,f=2,g=3,h=4,i=5,j=6,k=7;
        count++;
        recursion(a,b,c);
    }

    public static void recursion(){
//        long e=1,f=2,g=3,h=4,i=5,j=6,k=7;
        count++;
        recursion();
    }

    /**
     * 相同栈容量下，局部变量少的函数可以支持更深的函数调用
     */
    public static void main(String[] args) {
        try{
//            recursion(1,2,3);
            recursion();
        }catch (Throwable e){
            System.out.println("deep of calling = "+count);
            e.printStackTrace();
        }
    }
}
